//
//  SISSDBManger.h
//  SISSAPP
//
//  Created by 袁应荣 on 2018/3/13.
//  Copyright © 2018年 优房网. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <FMDB/FMDB.h>

@interface SISSDBManger : NSObject

/**
 dbQueue
 */
@property (nonatomic, strong) FMDatabaseQueue *dbQueue;

+ (instancetype)sharedManager;


/**
 缓存数据到数据库
 
 @param item 缓存数据
 @param cacheKey 缓存的Key
 */
- (void)insertItem:(id)item cacheKey:(NSString *)cacheKey;

/**
 通过缓存的key来获取对应的数据
 
 @param cacheKey 缓存的Key
 @return 缓存数据
 */
- (id)itemWithCacheKey:(NSString *)cacheKey;

/**
 清空所有缓存数据
 */
- (void)clearAll;


// 查询
- (void)queryArrayOfDicts:(NSString *)sql completion:(void(^)(NSMutableArray<NSMutableDictionary *> *dictArrayM))completion;


@end
